package dazuoye;
import java.util.*;

public class ScoreReport implements Iterable<FinalScore>{
    private ArrayList<FinalScore> finalscores=new ArrayList<FinalScore>();
    public ScoreReport(){ }
    public void addFScore(FinalScore finalscore){
        finalscores.add(finalscore);
    }
    public void removeFScore(FinalScore finalscore){
        finalscores.remove(finalscore);
    }
    public Iterator<FinalScore> iterator(){
        Iterator<FinalScore> b=finalscores.iterator();
        return b;
    }
    public FinalScore getFScore(ExamScore examscore){
        for(Iterator<FinalScore>iterator=this.finalscores.iterator();iterator.hasNext();){
           FinalScore finalscore=(FinalScore)iterator.next();
           if(finalscore.getExamScore().equals(examscore)){
              return finalscore;
           }
       }
       return null;
    }
    public int getNumberOfFScores(){
        return finalscores.size();
    }
    

}
